package fr.mystnihon.game.activity.view.scene;

import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.view.MotionEvent;
import android.view.SurfaceView;
import fr.mystnihon.game.R;
import fr.mystnihon.game.framework.Screen;
import fr.mystnihon.game.framework.impl.AndroidGame;
import fr.mystnihon.game.model.actor.Actor;

public class MainGameScreen extends Screen {

	Actor player;

	public MainGameScreen(AndroidGame game) {
		super(game);
		player = new Actor(BitmapFactory.decodeResource(game.getResources(),
				R.drawable.image), 10, 50);

	}

	@Override
	public void update(long deltaTime) {
		player.update(deltaTime);

	}

	@Override
	public void render(Canvas canvas) {
		canvas.drawColor(Color.BLACK);
		player.draw(canvas);
	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub

	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub

	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub

	}

	public void handleActions(MotionEvent event, SurfaceView view) {
		player.handleActions(event, view);
	}

	public void startCombat() {
		game.setScreen(new CombatScreen((AndroidGame) game));
	}
}
